'''
    class Solution {
        int res = 0;
        public int distributeCoins(TreeNode root) {
            dfs(root);
            return res;
        }
        int dfs(TreeNode root){
            if (root == null){
                return 0;
            }
            int l = dfs(root.left);
            int r = dfs(root.right);
            res += Math.abs(l+r+root.val-1);
            return l+r+root.val-1;
        }
    }
'''